home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Games / NetHack 3.1.3 / source / sys / mac / Install.thk < prev    next >
Encoding:
Text File  |  1993-08-01  |  6.6 KB  |  280 lines  |  [TEXT/R*ch]

  1. Notes on Building NH3.1.3 with Think C
  2.  
  3. In General
  4.  
  5.     What is different between MPW and Think C?
  6.  
  7.     Think C does not have a shell, :-(.  MPW does.  Ugh.  The lack of
  8. shell requires the cumbersome task of result file management.  Our approach
  9. has been to move all result files into the topmost directory.  This is done
  10. so that NetHack can be compiled and run from the topmost directory.  (In
  11. the future, we want to modify the compilers to place to result files into a
  12. result directory, and NetHack to look for its files in the result directory).
  13.  
  14.     Life without a shell also requires the NetHack resource file to 
  15. be put together by hand.  This is one area that Think C 6.0 has improved our
  16. lives.  Under 6.0, we can now add E.rsrc and E.r files as source to the
  17. project.  Dot rsrc files will be added to the project rsrc file directly and
  18. dot r files will be compiled and then added.  For those who are without Think
  19. 6.0, good luck.  The best approach is to use the resource compiler to compile
  20. the dot r file, and name the result as the projects rsrc file.
  21.  
  22.     Makedefs is another story.  When run, a command window pops up.  Just
  23. type in the options you require.  When the files are generated, some of the
  24. result files will have to be moved to the top level directory (data files) or
  25. to the include area (header files).
  26.  
  27.     Needless to say, all of the above stuff that we must do because of
  28. the lack of shell also implies no Makefile, so we must be aware of what
  29. files that we have modified and which files are dependent upon these modified
  30. files.  In other words, we must constantly ask ourselves "gee, do we need to
  31. run Makedefs again?".  Life is tuff; this is to help you get used to it.
  32.  
  33.     What follows are most of the steps that we take in compiling NH3.1.3.
  34. If some are left out, blame it on late night TV and a small PB screen.  If
  35. you find something left out, or think a little more detail is needed, send us
  36. some mail.
  37.  
  38.     This is the second release of these notes.  We are sure stuff has
  39. been left out.  So if you hit a snag, feel free to contact us.  We want and
  40. need to debug this port.
  41.  
  42.     We can be reached at nethack-bugs@linc.cis.upenn.edu
  43.  
  44. The Steps
  45.  
  46.     -2.    Read the Think C manuals.  Know your compiler and your
  47. environment.  They are your friends and you are stuck with them.
  48.     
  49.     -1.    Get Think Reference or buy a bunch of books that cover
  50. Macintosh programming (the correct number of books can be determined when you
  51. start seeing the same stuff over and over again -- or you run out of cash).
  52.         
  53.     0.    Learn C and the standard io library.
  54.     
  55.     From here, we will assume that you know how to build and compile
  56. projects, how file names are resolved, what a project's resource file is
  57. for, and how the resource compiler works.  If you don't, repeat the above
  58. steps.
  59.     
  60.     1.    Grab the sources, maintaining the directory structure.  We will
  61. refer to the top most directory as 'top'.
  62.  
  63.     2.    Move the project files to top.  The projects are MakeDefs.proj,
  64. DgnComp.proj, LevComp.proj and NetHack.proj.
  65.     
  66.     3. Modify the source
  67.  
  68.     sys:mac:hack.h
  69.         a. this should be deleted.  It is needed for the MPW build
  70.            and will interfere with the Think C compile.
  71.            
  72.     include:hack.h
  73.         a. this file should be renamed 'include:realhack.h'.
  74.         b. create a new file 'sys:mac:NetHack Headers.c'
  75.          with a single line :
  76.             #include "realhack.h"
  77.         c. precompile this new file and save the precompile output
  78.            as 'include:hack.h'
  79.  
  80.     sys:share:lev_lex.c sys:share:lev_yacc.c sys:share:lev_main.c
  81.         a. change inclusion of 'hack.h' to 'realhack.h'
  82.  
  83.     4. Move and/or rename files
  84.  
  85.         a. move top:sys:mac:MacHelp to top:MacHelp
  86.         b. move top:sys:mac:News to top:News
  87.         c. move and rename top:sys:mac:NHDeflts to
  88.          top:sys:mac:NetHack Defaults
  89.  
  90.     5. Build and run MakeDefs
  91.  
  92.         a. -v to build 'options'.
  93.         b. -o to create 'onames.h'.
  94.         c. -p to create 'pm.h'.
  95.         d. -z to create 'vis_tab.c'.
  96.         e. -e to create 'dundeon.pdf'.
  97.         f. -m to create 'monstr.c'.
  98.         g. -d to create 'data'.
  99.         Move 'top:dat:data' to 'top:data'.
  100.         h. -r to create 'rumors'.
  101.         Move 'top:dat:rumors' to 'top:rumors'.
  102.         i. -h to create 'oracles'.
  103.         Move 'top:dat:oracles' to 'top:oracles'.
  104.         j. -q to create 'quest.dat'.
  105.         Move 'top:dat:quest.dat' to 'top:quest.dat'.
  106.  
  107.         
  108.     6. Compile and run LevComp.
  109.  
  110.     7. Compile and run DgnComp.
  111.         Move 'top:dat:dungeon' to 'top:dungeon'.
  112.  
  113.     8. Compile and run NetHack.
  114.  
  115. Appendix
  116.  
  117. A. Futures
  118.  
  119.     1.    Modify NetHack to look for data files in the folder 'data'.
  120.     2.    Take advantage of the new scripting abilities of Think C 6.0.
  121.  
  122. B. Project Contents
  123.  
  124. All projects should have both far code and far data set.  Set the
  125. application size of NetHack.proj to a couple of megs.
  126.  
  127. Set the application size of LevComp.proj to a meg (We suspect that there is a
  128. memory leak in there somewhere).  All projects should contain the libraries
  129. MacTraps, ANSI, and unix.
  130.         
  131.         MakeDefs.proj should contain the following source files:
  132.         
  133.             objects.c
  134.             monst.c
  135.             MakeDefs.c
  136.             
  137.         DgnComp.proj should contain the following source files:
  138.             
  139.             dgn_lex.c
  140.             dgn_main.c
  141.             dgn_yacc.c
  142.             alloc.c
  143.             panic.c
  144.  
  145.         LevComp.proj should contain the following source files:
  146.         
  147.             monst.c
  148.             objects.c
  149.             drawing.c
  150.             alloc.c
  151.             panic.c
  152.             lev_lex.c
  153.             lev_yacc.c
  154.             macerrs.c
  155.             decl.c
  156.             lev_main.c
  157.             
  158.             add #define SPEC_LEV to prefix
  159.             
  160.         NetHack.proj should contain the following source files:
  161.  
  162.             allmain.c
  163.             alloc.c
  164.             apply.c
  165.             artifact.c
  166.             attrib.c
  167.             ball.c
  168.             bones.c
  169.             botl.c
  170.             cmd.c
  171.             dbridge.c
  172.             decl.c
  173.             detect.c
  174.             display.c
  175.             do.c
  176.             do_name.c
  177.             do_wear.c
  178.             dog.c
  179.             dogmove.c
  180.             dokick.c
  181.             dothrow.c
  182.             drawing.c
  183.             dungeon.c
  184.             eat.c
  185.             end.c
  186.             engrave.c
  187.             exper.c
  188.             explode.c
  189.             extralev.c
  190.             files.c
  191.             fountain.c
  192.             hack.c
  193.             hacklib.c
  194.             invent.c
  195.             lock.c
  196.             maccurs.c
  197.             macerrs.c
  198.             macfile.c
  199.             macmain.c
  200.             macmenu.c
  201.             macsnd.c
  202.             macunix.c
  203.             macwin.c
  204.             makemon.c
  205.             mcastu.c
  206.             mgetline.c
  207.             mhitm.c
  208.             mhitu.c
  209.             minion.c
  210.             mklev.c
  211.             mkmap.c
  212.             mkmaze.c
  213.             mkobj.c
  214.             mkroom.c
  215.             mmodal.c
  216.             mon.c
  217.             mondata.c
  218.             monmove.c
  219.             monst.c
  220.             monstr.c NOTE: created by MakeDefs -m, so add it later
  221.             mplayer.c
  222.             mstring.c
  223.             mthrowu.c
  224.             muse.c
  225.             music.c
  226.             o_init.c
  227.             objects.c
  228.             objnam.c
  229.             options.c
  230.             pager.c
  231.             pickup.c
  232.             pline.c
  233.             polyself.c
  234.             potion.c
  235.             pray.c
  236.             priest.c
  237.             quest.c
  238.             questpgr.c
  239.             random.c
  240.             read.c
  241.             rect.c
  242.             restore.c
  243.             rip.c
  244.             rnd.c
  245.             rumors.c
  246.             save.c
  247.             shk.c
  248.             shknam.c
  249.             sit.c
  250.             sounds.c
  251.             sp_lev.c
  252.             spell.c
  253.             steal.c
  254.             timeout.c
  255.             mactopl.c
  256.             topten.c
  257.             track.c
  258.             trap.c
  259.             u_init.c
  260.             uhitm.c
  261.             vault.c
  262.             version.c
  263.             vision.c
  264.             vis_tab.c    NOTE:generated by Makedefs
  265.             weapon.c
  266.             were.c
  267.             wield.c
  268.             windows.c
  269.             wizard.c
  270.             worm.c
  271.             worn.c
  272.             write.c
  273.             zap.c
  274.             getline.c
  275.             topl.c
  276.             wintty.c
  277.             mactty.c
  278.             mttymain.c
  279.             dprintf.c
  280.